<%@page import="com.yaodian100.ec.product.entity.OrderComment"%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ include file="/taglibs.jsp"%>
<link href="/css/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" charset="UTF-8" src="/js/jquery-ui-1.7.2.custom.min.js"></script>
<script language="javascript">
	$().ready( function() {
		<c-rt:if test="${orderComment.hideYn == 'N'}">$("#hidecomment").show();</c-rt:if>
    <c-rt:if test="${orderComment.hideYn == 'Y'}">$("#opencomment").show();</c-rt:if>
    $("#hidecomment").click(function(){
			$.post("commentProcess.do",{cmid:"${orderComment.cmid}",hide:"Y"},function(data) { hidecallback(data,"Y");},"json");
		});
    $("#opencomment").click(function(){
			$.post("commentProcess.do",{cmid:"${orderComment.cmid}",hide:"N"},function(data) { hidecallback(data,"N");},"json");
		});
    $("#approveOk").click(function(){
    	$("#commentStatus").val("APPROVE");
    	$("#approveComment").submit();
		});
    $("#approveFail").click(function(){
    	if ($("#failReason").val()=="") {
    		$("#failReason").focus();
    		$("#failMsg").text("请输入说明内容");
    		$("#failMsg").show();
    		return false;
    	} else {
    		$("#commentStatus").val("FAIL");
    		$("#approveComment").submit();
    	}
		});
    $("#commentRemark").click(function(){
    	if ($("#failReason").val()=="") {
    		$("#failReason").focus();
    		$("#failMsg").text("请输入说明内容");
    		$("#failMsg").show();
    		return false;
    	} else {
	    	$("#commentStatus").val("");
	    	$("#approveComment").attr("action","remarks.do");
	    	$("#approveComment").submit();
    	}
		});
	});
	function hidecallback(data,hide){
		if ( data == "true" ) {
			if (hide == "Y") {
		    $("#opencomment").show();
				$("#hidecomment").hide();
				$("#hideMsg").text("是");
			} else {
				$("#opencomment").hide();
				$("#hidecomment").show();
				$("#hideMsg").text("否");
			}
		}
	}
</script>
<p class="f-link"><a href="index.do">返回商品评价管理－查询</a></p>
<h1>商品评价管理－异动</h1>
<font color="#ff3300">
${updatemsg}
</font>
<table width="800" class="tb-2">
        <tr>
          <th width="70">评价编号：</th>
          <td>${orderComment.cmid}</td>
          <th width="70">订单编号：</th>
          <td>${orderComment.orderId}</td>
          <th width="100">订单编号明细:</th>
          <td>${orderComment.orderDetailId}</td>
        </tr>
        <tr>
          <th>商品编号：</th>
          <td>${orderComment.productId}</td>
          <th>商品名称：</th>
          <td colspan="3"><p>${orderComment.productName}</p></td>
        </tr>
        <tr>
          <th>会员编号：</th>
          <td>${orderComment.memberId}</td>
          <th>会员帐号：</th>
          <td colspan="3">${orderComment.loginId}</td>
        </tr>
      </table>
      <hr class="line-d" />
    <table width="800" class="tb-2">
        <tr>
          <th width="70">建立会员：</th>
          <td>${orderComment.createUser}</td>
          <th width="70">评价日期：</th>
          <td><fmt:formatDate value="${orderComment.createDate}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
          <th width="80">不核可次数:</th>
          <td width="30">${orderComment.failCount}</td>
          <th width="70">评价状态：</th>
          <td>${approveStMenu.options[orderComment.commentStatus].name}</td>
          <th width="70">赠送积分:</th>
          <td>${orderComment.bonus}</td>
        </tr>
    </table>
    <br />
    <table width="100%" class="comment-tb-a">
      <tr>
        <th><strong>${orderComment.subject}</strong>&nbsp;<div class="s-box star-<fmt:formatNumber value="${orderComment.score}" pattern="#0"/>-0"><span class="sr1">&nbsp;</span><span class="sr2">&nbsp;</span><span class="sr3">&nbsp;</span><span class="sr4">&nbsp;</span><span class="sr5">&nbsp;</span></div></th>
        <th><strong>尺码：</strong>${sizeMenu.options[orderComment.size].name}</th>
        <th>&nbsp;</th>
      </tr>
      <tr>
        <td colspan="3">${orderComment.content}</td>
      </tr>
      <tr>
        <td class="txt-gy txt-s">商品属性：${orderComment.specName}<span class="cmt-plase">商品送至：${orderComment.receiverProvince}</span></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    <p>&nbsp;</p>
    <table width="100%" class="tb-2">
      <tr>
        <th width="90">核可人员：</th>
        <td><p>${orderComment.approveMan}</p></td>
        <th width="90">核可日期:</th>
        <td><fmt:formatDate value="${orderComment.approveDate}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
        <th width="90">修改人员：</th>
        <td>${orderComment.modifyUser}</td>
        <th width="90">修改时间：</th>
        <td><fmt:formatDate value="${orderComment.modifyDate}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
      </tr>
    </table>
    <table width="100%" class="tb-1">
      <tr>
        <th valign="top"><p>隐藏评价：</p></th>
        <td valign="top"><p><span id="hideMsg">${hideYnStMenu.options[orderComment.hideYn].name}</span>　
          <c-rt:if test="${orderComment.commentStatus == '90'}">
          <input type="button" name="button" id="hidecomment" style="display: none" value="隐藏此笔评价" />
          <input type="button" name="button" id="opencomment" style="display: none" value="开启此笔评价" />
          </c-rt:if>
        </p></td>
      </tr>
      <tr>
        <th valign="top"><p>说明内容原因：</p></th>
        <td valign="top">
        <c:forEach items="${commentLogList}" var="commentLog" varStatus="rows_index"><p>${logtypeMenu.options[commentLog.type].name}:${commentLog.failReason}</p></c:forEach>
				<s:form action="approve.do" method="post" id="approveComment">
          <p>
            <textarea name="failReason" id="failReason" style="width:370px;"></textarea><div class="errmsg" align="left" sytle="display: none;text-align:left" id="failMsg"></div><input type="hidden" name="cmid" value="${orderComment.cmid}">
            <input type="hidden" name="commentStatus" id="commentStatus" value="">
          </p>
    <p><c-rt:if test="${orderComment.commentStatus == '10'}">
      <input type="button" name="button3" id="approveOk" value="核可" />
      <input type="button" name="button4" id="approveFail" value="不核可" />
      </c-rt:if>
      <c-rt:if test="${orderComment.commentStatus != '10'}">
      <input type="button" name="button5" id="commentRemark" value="更新说明内容" />
      </c-rt:if>
    </p></s:form></td>
      </tr>
    </table>
    <p>&nbsp;</p>
